package com.ys.chatserver.common.dto.cnst;

/**
 * rtc 通过redis缓存语音和视频相关常量key
 */
public class RtcRedisKeyConstants {

    public static final String PTT_GROUP_KEY = "ptt:key:";
    public static final String PTT_GROUP_KEYS = "ptt:key*";
    public static final String SOS_GROUP_KEY = "sos:key:";
    public static final String SOS_GROUP_KEYS = "sos:key*";
    public static final String ONE_GROUP_KEY = "one:key:";
    public static final String ONE_GROUP_KEYS = "one:key*";
    public static final String DEV_LIVE_STREAM_CHANNEL_MEMBER_KEY = "device:close:live:stream:";
    public static final String DEV_LIVE_STREAM_CHANNEL_MEMNER_KEYS = "device:close:live:stream*";
    public static final String DEV_ENV_KEY = "device:env:";
    public static final String DEV_FILE_LIST = "device:file:list:";
    public static final String CHANNEL_LISTEN_KEY = "channel:listen:";
    public static final String CHANNEL_LISTEN_KEYS = "channel:listen*";
    public static final String CHANNEL_LISTEN_USER_KEY = "channel:user:";
    public static final String CHANNEL_PTT_USER_KEY = "channel:ptt:user:";
    public static final String CHANNEL_LINSTEN_USER_KEYS = "channel:user*";
    public static final String DEVICE_LIVE_KEY = "device:live:key:";
    public static final String CLIENT_AUTH_PUBLIC_KEY = "client:auth:public:key:";
    public static final String TEMP = "TEMP";
    public static String GET_PTT_GROUP_KEY(String groupId, String channelId) {
        return PTT_GROUP_KEY + groupId + ":" + channelId;
    }
    public static String GET_SOS_GROUP_KEY(String groupId, String channelId) {
        return SOS_GROUP_KEY + groupId + ":" + channelId;
    }
    public static String GET_ONE_GROUP_KEY(String groupId, String level, String userId, String channelId) {
        return ONE_GROUP_KEY + groupId + ":" + level + ":" + userId + ":" + channelId;
    }
    public static String KEYS_ONE_GROUP(String groupId) {
        return ONE_GROUP_KEY + groupId + "*";
    }
    public static String CHANNEL_LISTEN_KEY(String groupId, String channelId) {
        return CHANNEL_LISTEN_KEY + groupId + ":" + channelId;
    }

    public static String CHANNEL_LISTEN_KEYS(String groupId) {
        return CHANNEL_LISTEN_KEY + groupId + "*";
    }

    public static String CHANNEL_LISTEN_USER_KEY(String userId, String groupId, String channelId) {
        return CHANNEL_LISTEN_USER_KEY + userId + ":" + channelId + ":" + groupId;
    }

    public static String CHANNEL_PTT_USER_KEY(String groupId, String channelId, String timestamp) {
        return CHANNEL_PTT_USER_KEY + groupId + ":" + channelId + ":" + timestamp;
    }

    public static String DEVICE_LIVE_KEY(String groupId, String userId) {
        return DEVICE_LIVE_KEY + groupId + ":" + userId;
    }

    public static String DEVICE_LIVE_KEYS(String groupId) {
        return DEVICE_LIVE_KEY + groupId + "*";
    }

    public static String DEV_FILE_LIST(String userId){
        return DEV_FILE_LIST +userId;
    }

    public static String CLIENT_AUTH_PUBLIC_KEY(String userId){
        return CHANNEL_LISTEN_KEY + userId;
    }
}
